package com.yxp.manager.common;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.NoArgsConstructor;

/**
 * 分页基础类
 * @author liuxinyu
 * @date 2019/9/5 11:24
 */
@NoArgsConstructor
public class Pagination<T> extends Page {

    public Pagination(long current, long size) {
        super(current, size);
    }

    public Pagination(long current, long size, long total) {
        super(current, size, total);
    }

    public Pagination(long current, long size, String column, boolean asc) {
        super(current, size);
        OrderItem orderItem = asc ? OrderItem.asc(column) : OrderItem.desc(column);
        this.orders().add(orderItem);
    }

}
